package com.company.behavioral.chain_of_responsibility_pattern.handler;

import com.company.behavioral.chain_of_responsibility_pattern.PurchaseRequest;

/**
 * 审批者
 * @ClassName Approver
 * @Author tiezheng.han
 * @Date 2020/9/2 10:22
 **/
public abstract class Approver {
    /**
     * 定义后继对象
     */
    protected Approver successor;

    /**
     * 审批者姓名
     */
    protected String name;

    public Approver(String name) {
        this.name = name;
    }

    /**
     * 设置后继者
     * @param successor
     */
    public void setSuccessor(Approver successor) {
        this.successor = successor;
    }

    /**
     * 抽象请求处理方法
     * @param request
     */
    public abstract void processRequest(PurchaseRequest request);
}
